# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Allan McRae <mcrae_allan@hotmail.com>
# Contributor: lp76 <l.peduto@gmail.com>

pkgname=gtk-vnc
pkgver=0.9.0
pkgrel=1
pkgdesc="A VNC viewer widget for GTK+"
url="https://wiki.gnome.org/Projects/gtk-vnc"
arch=(x86_64)
license=(LGPL)
depends=(libgcrypt gtk3 gnutls libpulse)
makedepends=(intltool vala gobject-introspection gnome-common git perl-text-csv)
_commit=8afbc55407c2625f9b1e64c53a0c0efd9939f6a8  # tags/v0.9.0^0
source=("git+https://gitlab.gnome.org/GNOME/gtk-vnc.git#commit=$_commit"
        git+https://gitlab.com/keycodemap/keycodemapdb.git)
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.src/keycodemapdb.url "$srcdir/keycodemapdb"
  git submodule update

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --with-examples --disable-static --disable-werror
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
